What will be the output of following program ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include void main() { int i=1; while (i<=5) { ...

      

What will be the output of following program ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include
void main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i==5)
goto print;
i++;
}
}
fun()
{
print:
printf("includehelp.com");
}

  

Answers


kinyua
Correct Answer - 1
Compiler error: Undefined label ‘print’ in function main.
Labels have functions scope, in other words the scope of the labels is limited to functions. The label ‘print’ is available in function fun() Hence it is not visible in function main.
monica20 answered the question on February 24, 2018 at 16:55


Next: What will be the output of following program ? 1 2 3 4 5 6 7 #include void main() { char cnt=0; for(;cnt++;printf("%d",cnt)) ; printf("%d",cnt); }
Previous: What will be the output of following program ? 1 2 3 4 5 6 7 8 9 10 11 12 #include < stdio.h > int main() { int tally=0; for(;;) ...

View More Computer Science Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions